package com.naicheng.ivote.views;

import android.content.Intent;

import com.naicheng.ivote.R;
import com.naicheng.ivote.constant.ConstantMine;
import com.naicheng.ivote.engin.BaseActivity;
import com.naicheng.ivote.utils.AppManager;
import com.naicheng.ivote.utils.MyPreferences;
import com.naicheng.ivote.utils.PhoneDeviceData;


public class SplashActivity extends BaseActivity{

	SplashActivity CTSA=SplashActivity.this;
	private MyPreferences preference;
	AppManager appManager = AppManager.getAppManager();
	
	@Override
	protected void setConentView() {
		super.setConentView();
		setContentView(R.layout.activity_splash);
	}

	@Override
	protected void init() {
		preference = MyPreferences.getPrefer(this);
		
		ConstantMine.isNetConn=PhoneDeviceData.isConnNET(CTSA);
		
		super.init();
	}

	@Override
	protected void processLogic() {
		super.processLogic();
		
//		startActivity(new Intent(CTSA,HotMainActivity.class));
		
		new Thread(new Runnable() {
			@Override
			public void run() {
				try {
					Thread.sleep(2000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				
				boolean isfirst = preference.getBoolean(ConstantMine.KEY_IS_FIRST, true);
				if(isfirst){
					startActivity(new Intent(CTSA,GuidActivity.class));
				}else{
					startActivity(new Intent(CTSA,CommonActivity.class));
				}
				appManager.finishActivity();
			}
		}){}.start();
	}

	@Override
	protected void setOnClickListener() {
		// TODO Auto-generated method stub
		super.setOnClickListener();
	}

	

	

}
